﻿#ifndef CMODBUSUNITCOIL_H
#define CMODBUSUNITCOIL_H

#include "cmodbusunitbase.h"


class CModbusUnitCoil : public CModbusUnitBase
{
    Q_OBJECT
public:

    bool isbit;
    int bit_offest;
    int bit_num;

    explicit CModbusUnitCoil(ESigType maptype, QObject *parent = nullptr);

signals:

public:
    virtual QString getFieldNameByCol(int col)override;

    virtual QVariant getFieldValueByFielddName(const QString& name)override;

    virtual void setFieldValueByCol(int col, const QVariant& value)override;

    virtual QJsonObject toJson()override;

    virtual void fromJson(const QJsonObject &obj)override;

    virtual QSharedPointer<IModel> createEmpty()override;

    virtual bool sync(bool dir = true)override{}

    virtual void changeBgColor(bool ischange);

    virtual bool checkData();

    void deleteReset();
};

#endif // CMODBUSUNITCOIL_H
